package com.ibeeking.gmc.global.g.rest.service;

import com.ibeeking.found.common.entity.open.OpenAuthDTO;
import com.ibeeking.found.common.entity.open.OpenAuthOfWxOpenFunc;
import com.ibeeking.found.common.entity.open.OpenAuthQuery;
import com.ibeeking.found.common.entity.open.SimpleOpenAuthDTO;
import com.ibeeking.gmc.global.api.common.param.OpenAuthCancelParam;
import com.ibeeking.gmc.global.api.common.param.OpenAuthModifyTenantIdParam;
import com.ibeeking.gmc.global.api.common.param.OpenAuthParam;
import com.ibeeking.gmc.global.service.common.vo.HasOpenAuthVO;

import java.util.List;

/**
 * @ClassName IOpenConfigService
 * @Description
 * @Author ibeeking
 * @Date 2021-06-16 16:06
 **/
public interface IOpenAuthService {
    /**
     * 更新授权
     *
     * @param param
     * @return
     */
    Boolean modifyAuth(OpenAuthParam param);

    /**
     * 取消授权
     *
     * @param param
     * @return
     */
    Boolean cancelAuth(OpenAuthCancelParam param);

    /**
     * 更新授权租户id
     * @param param
     * @return
     */
    Boolean modifyAuthTenantId(OpenAuthModifyTenantIdParam param);

    /**
     * 取得授权列表
     *
     * @return
     */
    List<OpenAuthDTO> queryOpenAuthList(OpenAuthQuery query);

    /**
     * 取得租户下有效的授权列表
     *
     * @return
     */
    List<SimpleOpenAuthDTO> querySimpleOpenAuthList(OpenAuthQuery query);

    /**
     * 取得授权信息
     *
     * @param query
     * @return
     */
    OpenAuthDTO queryOpenAuthOne(OpenAuthQuery query);
    /**
     * 取得授权信息
     *
     * @param query
     * @return
     */
    SimpleOpenAuthDTO querySimpleOpenAuthOne(OpenAuthQuery query);

    /**
     * 查询授权基本信息
     *
     * @param appId 被授权公众号/小程序的appId
     * @return
     */
    List<OpenAuthOfWxOpenFunc> queryOpenAuthFuncByAppId(String appId);
    /**
     * 查询授权基本信息
     *
     * @param authId 被授权公众号/小程序的appId
     * @return
     */
    List<OpenAuthOfWxOpenFunc> queryOpenAuthFuncByAuthId(Long authId);

    HasOpenAuthVO queryHasOpenAuth(Integer tenantId);

}
